/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package z.h.w.jar.kit.method;

import java.awt.image.BufferedImage;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

/**
 *
 * @author EnzoZhong
 */
public class Show {

      /**
       *
       * @param image
       */
      public static void print ( BufferedImage image ) {
            StringBuffer sb = new StringBuffer ();
            Integer[][] array = Foto.bufferedImage2IntegerArray ( image );
            for ( int x = 0 ; x < array.length ; x ++ ) {
                  for ( int y = 0 ; y < array[x].length ; y ++ ) {
                        sb.append ( array[x][y] );
                  }
                  sb.append ( "\n" );
            }
            System.out.println ( sb.toString () );
      }

      /**
       *
       * @param iterable
       */
      public static void print ( Iterable<?> iterable ) {
            for ( Iterator<?> iterator = iterable.iterator () ; iterator.hasNext () ; ) {
                  Object obj = iterator.next ();
                  System.out.println ( obj );
            }
      }

      /**
       *
       * @param collection
       */
      public static void print ( Collection<?> collection ) {
            for ( Iterator<?> iterator = collection.iterator () ; iterator.hasNext () ; ) {
                  Object obj = iterator.next ();
                  System.out.println ( obj );
            }
      }

      /**
       *
       * @param map
       */
      public static void print ( Map<? , ?> map ) {
            Set<?> set = map.keySet ();
            for ( Iterator<?> iterator = set.iterator () ; iterator.hasNext () ; ) {
                  Object key = iterator.next ();
                  System.out.println ( key + " : " + map.get ( key ) );
            }
      }

      /**
       *
       * @param array
       */
      public static void print ( Object[] array ) {
            for ( Object obj : array ) {
                  System.out.println ( obj );
            }
      }

}
